bitkeeper revision 1.1758 (42bff8419M7X5aOGlHhSQueJtvoYaA)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 27 Jun 2005 12:59:45 +0000 (12:59 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 27 Jun 2005 12:59:45 +0000 (12:59 +0000)
Fix out of source tree build bugs:
        - add (srctree)/include/asm-xen to include list
        - fix include2/asm link to reference asm-XENARCH
        - fix install target for public headeres
This fix enables the complication of several configurations from the same (read-only) source tree.

Signed-off-by: Shahar Frank <shaharf@qumranet.com>
linux-2.6.11-xen-sparse/arch/xen/Makefile

index 159006083dca20ffa59e86d56ef268edd92cedb5..133d6e6b0ff5548336028dd31450d302136a89ef 100644 (file)
@@ -16,12 +16,22 @@ XENARCH     := $(subst ",,$(CONFIG_XENARCH))
 
 # pick up headers from include/asm-xen/asm in preference over include/asm
 NOSTDINC_FLAGS  = -nostdinc -iwithprefix include/asm-xen -Iinclude/asm-xen -iwithprefix include
+ifneq ($(KBUILD_SRC),)
+NOSTDINC_FLAGS += -I$(srctree)/include/asm-xen
+endif
 
 # make uname return the processor arch
 UTS_MACHINE := $(XENARCH)
 
 core-y += arch/xen/kernel/
 
+.PHONY: include2/asm
+include2/asm:
+ifneq ($(KBUILD_SRC),)
+       @echo '  SYMLINK ../include/asm-$(XENARCH) -> include2/asm'
+       $(Q)ln -fsn ../include/asm-$(XENARCH) include2/asm
+endif
+
 include/.asm-ignore: include/asm
        @rm -f include/.asm-ignore
        @mv include/asm include/.asm-ignore
@@ -46,7 +56,7 @@ include/asm-$(ARCH)/asm_offsets.h: arch/$(XENARCH)/kernel/asm-offsets.s
        $(call filechk,gen-asm-offsets)
 
 prepare: include/.asm-ignore include/asm-xen/asm \
-       arch/xen/arch include/asm-$(ARCH)/asm_offsets.h ;
+       arch/xen/arch include/asm-$(ARCH)/asm_offsets.h include2/asm ;
 
 all: vmlinuz
 
@@ -64,7 +74,7 @@ install: vmlinuz
        install -m0664 System.map $(INSTALL_PATH)/boot/System.map-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
        ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_PATH)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
        mkdir -p $(INSTALL_PATH)/usr/include/xen/linux
-       install -m0644 include/asm-xen/linux-public/*.h $(INSTALL_PATH)/usr/include/xen/linux
+       install -m0644 $(srctree)/include/asm-xen/linux-public/*.h $(INSTALL_PATH)/usr/include/xen/linux
 
 archclean:
        @if [ -e arch/xen/arch ]; then $(MAKE) $(clean)=arch/xen/arch; fi;